const eventEmitter = require('events');

class MyEventEmitter extends eventEmitter {

}

const event = new MyEventEmitter();

event.on('play', (name) => {
    console.log(name + ' play pingpang');
})
event.once('play1', (name) => {
    console.log(name + ' play pingpang');
})

event.emit('play', 'tina')
event.emit('play1', 'tiga')
event.emit('play1', 'tiga')
event.emit('play1', 'tiga')
event.emit('play1', 'tiga')